package MONi_login;

public class Login
{
    private  String  name;
    private  String   pass;
//    2个构造方法，2个封装方法，一个tostring,一个equal

    public String getPass() {
        return pass;
    }

    public void setPass(String pass) {
        this.pass = pass;
    }

    @Override
    public String toString() {
        return "Login{" +
                "name='" + name + '\'' +
                ", pass='" + pass + '\'' +
                '}';
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }




    Login(){}
    public Login(String name, String pass) {
        this.name = name;
        this.pass = pass;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        Login login = (Login) o;

        if (name != null ? !name.equals(login.name) : login.name != null) return false;
        return pass != null ? pass.equals(login.pass) : login.pass == null;
    }

    @Override
    public int hashCode() {
        int result = name != null ? name.hashCode() : 0;
        result = 31 * result + (pass != null ? pass.hashCode() : 0);
        return result;
    }
}
